package com.ssh.api.action;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import sun.util.logging.resources.logging;

import com.opensymphony.xwork2.ActionSupport;
import com.ssh.common.log.LogFactory;
import com.ssh.common.log.LogName;
import com.ssh.common.util.JsonResult;
import com.ssh.manager.ActivityManager;
import com.ssh.manager.SellerManager;
@Controller
@ParentPackage("client")
@Scope("prototype")
@Results(value={@Result(name ="list",type="json",params={"root","jr","excludeProperties","data\\[\\d+\\]\\.brand\\.createDate,data\\[\\d+\\]\\.brand\\.del","excludeNullProperties","true"})
})

public class SellerClientAction extends ActionSupport {
	private static final long serialVersionUID = 970773022382019911L;
	JsonResult jr=new JsonResult();
	

	@Resource(name="sellerManagerImpl")
	private SellerManager sellerManagerImpl;
	private long superMarketId;
	
	public long getSuperMarketId() {
		return superMarketId;
	}

	public void setSuperMarketId(long superMarketId) {
		this.superMarketId = superMarketId;
	}

	public String  list( ) {
		jr.setMethod("list");
		try{
	    	jr.setCode("0");
	    	jr.setData(sellerManagerImpl.getAllBySuperMarketId(superMarketId));	
		}catch (Exception e) {
			jr.setCode("-1");
			jr.setMessage(e.getMessage());
			LogFactory.getDefaultLog().error("查询失败", LogName.API);
		}
		return "list";
	}

	public JsonResult getJr() {
		return jr;
	}

	public void setJr(JsonResult jr) {
		this.jr = jr;
	}
	


	
}
